package review;

/**
 * @author 航
 * @date 2024/07/20 12:04
 **/
public class NoVisibility {
    private static boolean ready;
    private static int number;

    public static void main(String[] args) throws InterruptedException {
        new Thread(() -> {
            while (!ready){
                System.out.println("1111");
                Thread.yield();
            }
            System.out.println(number);
        }).start();
        number = 42;
        ready = true;
    }
}
